Skip to content

Instantly share code, notes, and snippets.

@jinsley8
jinsley8 / google-analytics.php
Created February 13, 2022 17:51
Enqueue Google Analytics 4 script without tracking Admin
/**
* Enqueue Google Analytics 4 script
*
*/
/* Add Google Analytics 4 Site Tag as close to
the opening <head> tag as possible
=====================================================*/
define("GA4","G-XXXXXX", false); // Replace GA4 ID
@rjescobar
rjescobar / extend-trial-jetbrains-windows.bat
Created August 31, 2021 02:53
JetBrains IDE trial reset windows
REM Delete eval folder with licence key and options.xml which contains a reference to it
for %%I in ("WebStorm", "IntelliJ", "CLion", "Rider", "GoLand", "PhpStorm", "Resharper", "PyCharm") do (
for /d %%a in ("%USERPROFILE%\.%%I*") do (
rd /s /q "%%a/config/eval"
del /q "%%a\config\options\other.xml"
)
)
REM Delete registry key and jetbrains folder (not sure if needet but however)
rmdir /s /q "%APPDATA%\JetBrains"

Useful Postgres Commands

1. Determine disk usage of a particular table/database

For a particular table,

SELECT pg_size_pretty( pg_total_relation_size('tablename') );
@Faria-Ejaz
Faria-Ejaz / Map.js
Last active May 9, 2024 16:08
react Leaflet Map with Auto-suggest Search #leaflet #react-leaflet #search
/** @format */
import { Map, TileLayer, Marker, Popup } from "react-leaflet";
import React, { useEffect, useState, useRef } from "react";
import { geosearch } from "esri-leaflet-geocoder";
import "leaflet/dist/leaflet.css";
import "esri-leaflet-geocoder/dist/esri-leaflet-geocoder.css";
import L from "leaflet";
function MapView(props) {
@LukeMathWalker
LukeMathWalker / audit.yml
Last active May 9, 2024 16:07
GitHub Actions - Rust setup
name: Security audit
on:
schedule:
- cron: '0 0 * * *'
push:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
jobs:
security_audit:
@matusstafura
matusstafura / basic-operations-in-stacks-in-php.php
Created January 12, 2023 07:54
Basic operations in stacks in PHP
<?php
class Node
{
public $value;
public $next;
public function __construct($value)
{
$this->value = $value;
@ctjhoa
ctjhoa / gist:127244335a1dc13100214f6076c8480e
Created September 23, 2020 23:00
Install percona without password archlinux

Install percona on archlinux without root password

Install packages

$ pacman -S percona-server-clients percona-server

Start mysql & connect

@jonmircha
jonmircha / helpHttp.js
Last active May 9, 2024 16:03
Script que te permite simplificar peticiones HTTP con Fetch, esta escrita en VanillaJS por lo que puedes usarla con cualquier framework o librería
export const helpHttp = () => {
const customFetch = (endpoint, options) => {
const defaultHeader = {
accept: "application/json",
};
const controller = new AbortController();
options.signal = controller.signal;
options.method = options.method || "GET";
@mtisz
mtisz / mixtral-8x22B.yaml
Created May 9, 2024 14:57
Axolotl Config for Mixtral-8x22B
base_model: mistral-community/Mixtral-8x22B-v0.1
model_type: MixtralForCausalLM
tokenizer_type: AutoTokenizer
is_mistral_derived_model: false
trust_remote_code: true
load_in_8bit: false
load_in_4bit: true
strict: false
@calexandre
calexandre / merge-zsh-history.sh
Last active May 9, 2024 15:56
Merge two zsh history files
#!/bin/bash
# Inspired on https://david-kerwick.github.io/2017-01-04-combining-zsh-history-files/
set -e
history1=$1
history2=$2
merged=$3
echo "Merging history files: $history1 + $history2"
test ! -f $history1 && echo "File $history1 not found" && exit 1